package IC.lir.Instrunction;


import java.util.LinkedList;

public class VirtualFunctionCallInstruction extends NonLibraryFunctionCallInstruction {
	
	private int _funcOffSet;
	private Register _object;
	
	public VirtualFunctionCallInstruction(Register retRegister, Register object, int funcOffSet, LinkedList<Data> params, IC.AST.FunctionCall node)
	{
		super(retRegister, params, node);
		_object = object;
		_funcOffSet = funcOffSet;
	}
	
	public String toString()
	{
		return String.format("VirtualCall %s.%d(this=%s%s%s), %s", 
				_object.toString(),
				_funcOffSet, 
				_object.toString(), 
				_params.size() != 0 ? ", " : "",
				ParamsListToString(_params),
				_retRegister);
	}
}
